﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SXMeteorological.Data.Utility
{
    public class CreateMap
    {
        public static void CreateFeatureMap(string interfaceName, string returnValue, string dataCode, string featureName, string mapName, string time, string colorpath, string hourOrday)
        {
            RegionType region = new RegionType();
            foreach (KeyValuePair<string, RegionPro> item in region._regionType)
            {
                Dictionary<String, String> params1 = new Dictionary<String, String>();
                RegionPro pro = new RegionPro();
                params1.Add("dataCode", dataCode); // 资料代码     。。。
                params1.Add("elements", returnValue);// 检索要素：站号、小时降水
                params1.Add("times", time); // 检索时间20151209060000
                params1.Add("staLevels", "011,012,013");
                string map = string.Empty;
                string regionName = string.Empty;
                string _blnPath = string.Empty;
                map = item.Key + mapName;
                regionName = item.Key;
                pro = item.Value;
                params1.Add("adminCodes", pro.RegionCode);
                Render render = new Render(item.Key, time, pro, params1, interfaceName, featureName, map, colorpath, hourOrday);
                render.RenderMap();
            }
        }
        //区域站
        public static void CreateFeatureMap1(string interfaceName, string returnValue, string dataCode, string featureName, string mapName, string time, string colorpath, string hourOrday)
        {
            RengionCountry region = new RengionCountry();
            foreach (KeyValuePair<string, RegionPro> item in region._regionType)
            {
                Dictionary<String, String> params1 = new Dictionary<String, String>();
                RegionPro pro = new RegionPro();
                params1.Add("dataCode", dataCode); // 资料代码     。。。
                params1.Add("elements", returnValue);// 检索要素：站号、小时降水
                params1.Add("times", time); // 检索时间20151209060000
                params1.Add("staLevels", "014");
                string map = string.Empty;
                string regionName = string.Empty;
                string _blnPath = string.Empty;
                map = item.Key + mapName;
                regionName = item.Key;
                pro = item.Value;
                params1.Add("adminCodes", pro.RegionCode);
                RegionRender render = new RegionRender(item.Key, time, pro, params1, interfaceName, featureName, map, colorpath, hourOrday);
                render.RenderMap();
            }
        }
        public static void FeatureMap(string interfaceName, string returnValue, string dataCode, string featureName, string mapName, string time, string hourOrday)
        {
            RegionType region = new RegionType();
            foreach (KeyValuePair<string, RegionPro> item in region._regionType)
            {
                Dictionary<String, String> params1 = new Dictionary<String, String>();
                params1.Add("dataCode", dataCode); // 资料代码     。。。
                params1.Add("elements", returnValue);// 检索要素：站号、小时降水
                params1.Add("times", time); // 检索时间20151209060000
                params1.Add("staLevels", "011,012,013");
                string map = string.Empty;
                map = item.Key + mapName;
                string regionName = string.Empty;
                string _blnPath = string.Empty;
                RegionPro pro = new RegionPro();
                regionName = item.Key;
                pro = item.Value;
                params1.Add("adminCodes", pro.RegionCode);
                WindRenderMap Rend = new WindRenderMap(item.Key, time, pro, params1, interfaceName, featureName, map, hourOrday);
                Rend.TSMI_GrADSBarb();
              
            }
        }

        public static void CreateSoilFeatureMap(string interfaceName, string returnValue, string dataCode, string featureName, string mapName, string time, string colorpath, string hourOrday, string soilDepths)
        {
           string publicPath=AppDomain.CurrentDomain.BaseDirectory;
            RegionPro item = new RegionPro();
            item.XMin = 105.489060;
            item.XMax = 111.246800;
            item.YMin = 31.712748;
            item.YMax = 39.582336;
            item.BlnPath = publicPath + @"boundary\陕西省.bln";
            item.ShowCityNameDatPath = publicPath + @"cityDat\陕西省.dat";
            item.RegionCode = "610000";
            item.Height = 576;
            item.Width = 800;
            item.left = 0.0;
            item.top = 0.2;
            Dictionary<String, String> params1 = new Dictionary<String, String>();
            params1.Add("dataCode", dataCode); // 资料代码     。。。
            params1.Add("elements", returnValue);// 检索要素：站号、小时降水
           params1.Add("times", time); // 检索时间20151209060000
           string map = string.Empty;
            string regionName = string.Empty;
           string _blnPath = string.Empty;
          map = "陕西省" + mapName;
           params1.Add("soilDepths", soilDepths);
          params1.Add("adminCodes", "610000");
           regionName = "陕西省";
          Render render = new Render(regionName, time, item, params1, interfaceName, featureName, map, colorpath, hourOrday);
            render.RenderMap();
            
        }
    }
}
